<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">
    <title>添加酒店</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
</head>
<body>
<script type="text/javascript">
    jQuery(function () {
        $('form[name="add"] input[name="hotelName"]').validatebox({
            required: true,
            validType: 'length[2,30]',
            missingMessage: '请输入用户名',
            invalidMessage: '用户名长度为2-30 位'
        });
        //加载酒店类型
        $('form[name="add"] #hotelType').combobox({
            required: true,
            editable: false,
            missingMessage: '请选择酒店类型',
            panelHeight: 'auto',
            url: 'hotelAction!getHotelType',
            method: 'post',
            valueField: 'hotelType',
            textField: 'hotelType'
        });

        $('form[name="add"] #cityName').combobox({
            mode: 'remote',
            //editable :       false,
            required: true,
            invalidMessage: '请选择城市',
            panelHeight: 'auto',
            url: 'cityAction!getAllCityName',
            method: 'post',
            valueField: 'name',
            textField: 'name',
            onSelect: function () {
                var value = $('form[name="add"] #cityName').combobox('getText');
                $("#landmarks").combobox({
                    mode: 'remote',
                    //editable :       false,
                    required: true,
                    invalidMessage: '请选择主要地标',
                    panelHeight: 'auto',
                    url: 'cityAction!getLandmarks?cityName=' + value,
                    method: 'get',
                    valueField: 'cityId',
                    textField: 'landmarks',
                    onSelect: function () {
                        var value = $('form[name="add"] #landmarks').combobox('getText');
                    }
                })
            },
        });

    })
</script>
<div class="easyui-layout" data-options="fit:true">
    <div data-options="region:'west',split:true" style="width:280px;">
        <form id="add" name="add" style="margin:0;padding:5px 0 0 20px;color:#333;">
            <table border="0">
                <tr>
                    <td>酒店名称</td>
                    <td><input type="text" class="textbox" name="hotelName" id="hotelName" value=""/></td>
                </tr>
                <tr>
                    <td>酒店编码</td>
                    <td><input type="text" class="textbox" name="hotelCode" id="hotelCode" value=""></td>
                </tr>
                <tr>
                    <td>酒店类型</td>
                    <td><input type="text" class="easyui-combobox" name="hotelType" id="hotelType" value=""/></td>
                </tr>
                <tr>
                    <td>所在城市</td>
                    <td><input type="text" class="easyui-combobox" name="cityName" id="cityName" value=""/></td>
                </tr>
                <tr>
                    <td>主要地标</td>
                    <td><input type="text" class="easyui-combobox" name="landmarks" id="landmarks"/></td>
                </tr>
                <tr>
                    <td>区域名称</td>
                    <td><input type="text" class="textbox" name="areaName" id="areaName" value=""/></td>
                </tr>
                <tr>
                    <td>酒店图片</td>
                </tr>
                <tr>
                    <td colspan="2"><input  type="file" onchange="change_photo()" name="picture" id="picture"/></td>
                </tr>
                <tr>
                    <td>酒店描述</td>
                    <td><textarea cols="20" rows="3" name="hotelDesc" id="hotelDesc" style="	border-radius: 5px;-moz-border-radius: 5px;
			-webkit-border-radius: 5px;"></textarea>
                </tr>
            </table>
        </form>
    </div>
    <div data-options="region:'center'" style="padding:10px">
        <div id="Imgdiv">
            <img id="Img" width="100%" height="250px"/>
        </div>
    </div>
</div>

</body>
</html>
